import request from '@/utils/request'

// 获取供应商信息
export function GetSupplierInfo(id) {
    return request({
        url: `/api/BaseData/Supplier/${id}`,
        method: 'GET'
    })
}

// 获取供应商信息
export function GetSupplierInfoList(id) {
    return request({
        url: `/api/BaseData/Supplier/${id}`,
        method: 'POST'
    })
}

// 获取供应商信息列表
export function GetSupplierList(data) {
    return request({
        url: `/api/BaseData/Supplier`,
        method: 'GET',
        data
    })
}

// 添加供应商信息
export function createSupplier(data) {
    return request({
        url: '/api/BaseData/Supplier',
        method: 'POST',
        data
    })
}

// 更新供应商信息
export function updateSupplier(data) {
    return request({
        url: `/api/BaseData/Supplier/${data.id}`,
        method: 'PUT',
        data
    })
}

// 批量删除供应商信息
export function DelSupplierBatch(data) {
    return request({
        url: `/api/BaseData/Supplier/BatchRemove`,
        method: 'POST',
        data
    })
}
// 删除供应商信息
export function DelSupplier(id) {
    return request({
        url: `/api/BaseData/Supplier/${id}`,
        method: 'DELETE'
    })
}
// 获取所有供应商信息
export function GetSupplierAll() {
    return request({
        url: `/api/BaseData/Supplier/All`,
        method: 'GET'
    })
}
// 导出供应商信息
export function exportData(data) {
    return request({
        url: `/api/BaseData/Supplier/Actions/Export`,
        method: 'GET',
        data
    })
}
//导入数据
export function ImportData(data){
    return request({
        url: `/api/BaseData/Supplier/ImportData`,
        method: 'Post',
        data
    })
}
//导入预览
export function ImportPreview(data){
    return request({
        url: `/api/BaseData/Supplier/ImportPreview`,
        method: 'Get',
        data
    })
}
//模板下载
export function TemplateDownload(){
    return request({
        url: `/api/BaseData/Supplier/TemplateDownload`,
        method: 'Get'
    })
}